package com.gujiangbo.magic;

import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

/**
 * @Author: gujiangbo.co
 * @Contact: 646832012@qq.com
 * @Date: 2021/12/7 19:31
 * @Version: 1.0
 * @Description:
 */
public class ParameterizedTypeClient {

    public static void main(String[] args) {
        Field[] fields = Person.class.getDeclaredFields();
        //ParameterizedType 参数化类型
        for (Field field : fields) {
            System.out.println(field.getName() + ":" + field.getGenericType().getTypeName() + ":" + (field.getGenericType() instanceof ParameterizedType));
            // ParameterizedType type = (ParameterizedType)field.getGenericType();
            // System.out.println(field.getName() + type.getRawType());

        }

    }
}
